<div class="editor">
	<input type="hidden" name="sid" value="<{$sid}>"/>
	<span>当前学生：</span><span><{$editorInfo.stname}></span><span>专业：</span><span><{$editorInfo.major}></span><span>班级：</span><span><{$editorInfo.class}></span>
</div>
<hr>
<div class="sanction-one">
<center><span>请输入年份：</span><input style="width:230px;" class="search_input" type="text" name="year" value="<{$year}>"/><button class="btn btn-primary" name="lookSanction">查看</button></center>
</div>
<hr>
<div class="snaction-two">
	<span>选择学期：<select name="term"><option value="up" selected>上半学期</option><option value="down">下半学期</option></select></span>
		<span>补考门数：<input type="text" style="width:130px;" name="bkms" value="<{$sanction['up']['bkms']}>"/>门</span>
		<span>重修门数：<input type="text" style="width:130px;" name="cxms" value="<{$sanction['up']['cxms']}>"/>门</span>

</div>
<hr>
<div class="sanction-three">
	<span>智育班级排名：<input type="text" style="width:130px;" name="zybjpm" value="<{$sanction['zybjpm']}>"/></span>
	<span>综合测评班级排名：<input type="text" style="width:130px;" name="zhcpbjpm" value="<{$sanction['zhcpbjpm']}>"/></span>
</div>
<hr>
<div class="sanction-four">
	<h4>校内成就</h4>
	<p>
		<label for="xsh"><input type="checkbox" name="xsh" id="xsh" value="0"/> 校三好</label>
		<label for="xjxj"><input type="checkbox" name="xjxj" id="xjxj" value="0"/> 校奖学金</label>
		<label for="xyg"><input type="checkbox" name="xyg" id="xyg" value="0"/> 校优干</label>
		<label for="xshbb"><input type="checkbox" name="xshbb" id="xshbb" value="0"/> 校三好标兵</label>
		<label for="xygbb"><input type="checkbox" name="xygbb" id="xygbb" value="0"/> 校优干标兵</label>
		<label for="xyxbys"><input type="checkbox" name="xyxbys" id="xyxbys" value="0"/> 校优秀毕业生</label>
	</p>
	<p>
		校内其他成就：<textarea verticle="center" rows="5" style="width:60%" name="xnqtcj"><{$sanction['xnqtcj']}></textarea>
	</p>
    <hr>
	<h4>校外成就</h4>
	<p>
		<span><label for="ssh"><input type="checkbox" name="ssh" id="ssh" value="0"/> 省三好</label></span>
		<span><label for="gjzxj"><input type="checkbox" name="gjzxj" id="gjzxj" value="0"/> 国家助学金</label></span>
		<span><label for="gjlzjxj"><input type="checkbox" name="gjlzjxj" id="gjlzjxj" value="0"/> 国家励志奖学金</label></span>
		<span><label for="gjjxj"><input type="checkbox" name="gjjxj" id="gjjxj" value="0"/> 国家奖学金</label></span>
		<span><label for="syxbys"><input type="checkbox" name="syxbys" id="syxbys" value="0"/> 省优秀毕业生</label></span>
	</p>
	<p>
		校外其他成就：<textarea verticle="center" rows="5" style="width:60%" name="xwqtcj"><{$sanction['xwqtcj']}></textarea>
	</p>
    <hr>
	<p>
		<h4>处分</h4>
		<textarea rows="5" style="width:75%" name="cf"><{$sanction['cf']}></textarea>
	</p>
</div>
        <hr>
<center><button class="btn btn-large btn-primary" name="submit">提交数据</button></center>
<script>
	var up_bkms="<{$sanction['up']['bkms']}>";
	var up_cxms="<{$sanction['up']['cxms']}>";
	var down_bkms="<{$sanction['down']['bkms']}>";
	var down_cxms="<{$sanction['down']['cxms']}>";
	var bkms=document.getElementsByName("bkms")[0];
	var cxms=document.getElementsByName("cxms")[0];
	var xsh=document.getElementsByName("xsh")[0];
	var xjxj=document.getElementsByName("xjxj")[0];
	var xyg=document.getElementsByName("xyg")[0];
	var xshbb=document.getElementsByName("xshbb")[0];
	var xygbb=document.getElementsByName("xygbb")[0];
	var xyxbys=document.getElementsByName("xyxbys")[0];
	var ssh=document.getElementsByName("ssh")[0];
	var gjzxj=document.getElementsByName("gjzxj")[0];
	var gjlzjxj=document.getElementsByName("gjlzjxj")[0];
	var gjjxj=document.getElementsByName("gjjxj")[0];
	var syxbys=document.getElementsByName("syxbys")[0];
	var submit=document.getElementsByName("submit")[0];
	var sid=document.getElementsByName("sid")[0];
	var lookSanction=document.getElementsByName("lookSanction")[0];	
	bkms.onblur=function(){//补考门数失去焦点时
		if((document.getElementsByName("term")[0]).value=="up"){
			up_bkms=bkms.value;
		}else{
			down_bkms=bkms.value;
		}
	}
	cxms.onblur=function(){//冲绣门数失去焦点时
		if((document.getElementsByName("term")[0]).value=="up"){
			up_cxms=cxms.value;
		}else{
			down_cxms=cxms.value;
		}
	}
	var term=document.getElementsByName("term")[0];
	term.onchange=function(){//学期发生改变时
		if(this.value=="up"){
			bkms.value=up_bkms;
			cxms.value=up_cxms;
		}else{
			bkms.value=down_bkms;
			cxms.value=down_cxms;
		}
	}
	var input=document.getElementsByTagName("input");
	var j;
	if("<{$sanction['xsh']}>"=="1"){
		xsh.checked=true;
		xsh.value="1";
	}
	if("<{$sanction['xjxj']}>"=="1"){
		xjxj.checked=true;
		xjxj.value="1";
	}
	if("<{$sanction['xyg']}>"=="1"){
		xyg.checked=true;
		xyg.value="1";
	}
	if("<{$sanction['xshbb']}>"=="1"){
		xshbb.checked=true;
		xshbb.value="1";
	}
	if("<{$sanction['xygbb']}>"=="1"){
		xygbb.checked=true;
		xygbb.value="1";
	}
	if("<{$sanction['xyxbys']}>"=="1"){
		xyxbys.checked=true;
		xyxbys.value="1";
	}
	if("<{$sanction['ssh']}>"=="1"){
		ssh.checked=true;
		ssh.value="1";
	}
	if("<{$sanction['gjzxj']}>"=="1"){
		gjzxj.checked=true;
		gjzxj.value="1";
	}
	if("<{$sanction['gjlzjxj']}>"=="1"){
		gjlzjxj.checked=true;
		gjlzjxj.value="1";
	}
	if("<{$sanction['gjjxj']}>"=="1"){
		gjjxj.checked=true;
		gjjxj.value="1";
	}
	if("<{$sanction['syxbys']}>"=="1"){
		syxbys.checked=true;
		syxbys.value="1";
	}
	xsh.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	xjxj.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	xyg.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	xshbb.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	xygbb.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	xyxbys.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	ssh.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	gjzxj.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	gjlzjxj.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	gjjxj.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	syxbys.onclick=function(){
		if(this.value=="1"){
			this.value="0";
		}else{
			this.value="1";
		}
	};
	var sanction=new PureAjax();
		submit.onclick=function(){
			sanction.post({
				dataType:"text",
				data:{
					year:(document.getElementsByName("year")[0]).value,
					bkms1:up_bkms,
					cxms1:up_cxms,
					bkms2:down_bkms,
					cxms2:down_cxms,
					zybjpm:(document.getElementsByName("zybjpm")[0]).value,
					zhcpbjpm:(document.getElementsByName("zhcpbjpm")[0]).value,
					xsh:(document.getElementsByName("xsh")[0]).value,
					xjxj:(document.getElementsByName("xjxj")[0]).value,
					xyg:(document.getElementsByName("xyg")[0]).value,
					xshbb:(document.getElementsByName("xshbb")[0]).value,
					xygbb:(document.getElementsByName("xygbb")[0]).value,
					xyxbys:(document.getElementsByName("xyxbys")[0]).value,
					xnqtcj:(document.getElementsByName("xnqtcj")[0]).value,
					ssh:(document.getElementsByName("ssh")[0]).value,
					gjzxj:(document.getElementsByName("gjzxj")[0]).value,
					gjlzjxj:(document.getElementsByName("gjlzjxj")[0]).value,
					gjjxj:(document.getElementsByName("gjjxj")[0]).value,
					syxbys:(document.getElementsByName("syxbys")[0]).value,
					xwqtcj:(document.getElementsByName("xwqtcj")[0]).value,
					cf:(document.getElementsByName("cf")[0]).value,
					submit:"yes"
				},
				url:URL+"Editor/createNewSanction/sid/"+sid.value,
				success:function(data){
					alert(data);
				}
			});
		}
	
	lookSanction.onclick=function(){
		sanction.post({
			dataType:"html/js",
			data:{method:"modify",year:(document.getElementsByName("year")[0]).value},
			url:URL+"Editor/createNewSanction/sid/"+sid.value,
			success:function(data){
				pure.dealJSinHTML(data,"editor-area");
			}
		});
	}
	
</script>